import math


class Solution:
    def kthCharacter(self, k: int) -> str:
        def mapping(c):
            if c == 'z': return 'a'
            return chr(ord(c) + 1)

        if k == 1:
            return 'a'
        if (k & (k - 1)) == 0:
            d = k >> 1
        else:
            d = 2 ** int(math.log2(k))
        return mapping(self.kthCharacter(k - d))


if __name__ == '__main__':
    s = Solution()
    r = s.kthCharacter(10)
    print(r)
